import request from '@/api/socialized-servce/index.js' //引入http.js
const api = request
export default {

	/**
	 * 条件分页查询
	 * @param {object} params PageConditionProject
	 * @param {number} params.page
	 * @param {number} params.size
	 * @param {array} params.sortList
	 * @param {object} params.condition 项目订单
	 * @returns
	 */
	queryPageByCondition(params) {
		return api.request(`service/reportExecute/queryPageByCondition`, 'post', {
			...params
		});
	},
	/**
	 * 条件查询
	 * @param {object} params 该服务类型下项目
	 * @param {boolean} params.richEntity
	 * @param {string} params.providerNo 运营方编号
	 * @param {number} params.id ID
	 * @param {string} params.serviceTypeNo 类型编号
	 * @param {string} params.serviceProjectNo 项目编号
	 * @param {string} params.parentServiceProjectNo 上级项目编号
	 * @param {string} params.name 名称
	 * @param {string} params.remark 备注
	 * @param {string} params.picture 图片路径
	 * @param {string} params.status 开关状态,可用值:OFF,ON
	 * @param {number} params.svcClassId
	 * @param {string} params.serviceTypeName 服务类型名称
	 * @param {array} params.serviceTypeNos
	 * @returns
	 */
	servicequeryByCondition(params) {
		return api.request(`service/service/project/queryByCondition`, 'post', params);
	},

	/**
	 * 查询订单详细信息
	 * @param {string} executeNo
	 * @returns
	 */
	queryOrder(executeNo) {
		return api.request(`service/reportExecute/queryOrderDetails?executeNo=${executeNo}`, 'get');
	},
	/**
	 * 根据订单查询最新报价单
	 * @param {string} orderNo
	 * @returns
	 */
	queryQuotation(orderNo) {
		return api.request(`service/orderQuotation/queryQuotation?orderNo=${orderNo}`, 'get');
	},
	/**
	 * 同意订单(完成，关闭)
	 * @param {string} projectNo
	 * @returns
	 */
	agree(projectNo) {
		return api.request(`service/orderApply/agree?projectNo=${projectNo}`, 'get');
	},
	/**
	 * 拒绝订单(完成，关闭)
	 * @param {string} projectNo
	 * @param {string} reason
	 * @returns
	 */
	refuse(projectNo, reason) {
		return api.request(`service/orderApply/refuse?projectNo=${projectNo}&reason=${reason}`, 'get');
	},
	/**
	 * id删除
	 * @param {string} id
	 * @returns
	 */
	del(id) {
		return api.request(`service/project/del?id=${id}`, 'delete');
	},

	/**
	 * 执行单申请完成
	 * @param {string} executeNo
	 * @param {string} reason
	 * @returns
	 */
	applyCompleteExecute(executeNo) {
		return api.request(`service/orderApply/applyCompleteExecute?executeNo=${executeNo}`, 'get');
	},
	/**
	 * 执行单申请关闭
	 * @param {string} executeNo
	 * @param {string} reason
	 * @returns
	 */
	applyCloseExecute(params) {
		return api.request(`service/orderApply/applyCloseExecute?executeNo=${params.executeNo}&reason=${params.reason}`, 'get');
	},
	/**
	 * 接单
	 * @param {string} executeNo
	 * @returns
	 */
	receiveOrder(executeNo) {
		return api.request(`service/reportExecute/receiveOrder?executeNo=${executeNo}`, 'get');
	},
}